<?php

namespace Kunfeng\Dify\Client;

use Kunfeng\Dify\Callback\WorkflowStreamCallback;
use Kunfeng\Dify\Exception\DifyApiException;
use Kunfeng\Dify\Model\Workflow\WorkflowRunRequest;
use Kunfeng\Dify\Model\Workflow\WorkflowRunResponse;
use Kunfeng\Dify\Model\Workflow\WorkflowRunStatusResponse;
use Kunfeng\Dify\Model\Workflow\WorkflowStopResponse;
use Kunfeng\Dify\Model\Workflow\WorkflowLogsResponse;
use Kunfeng\Dify\Model\Common\SimpleResponse;

/**
 * Dify 工作流应用客户端接口
 */
interface DifyWorkflowClientInterface extends DifyBaseClientInterface
{
    /**
     * 运行工作流（阻塞模式）
     */
    public function runWorkflow(WorkflowRunRequest $request): WorkflowRunResponse;

    /**
     * 运行工作流（流式模式）
     */
    public function runWorkflowStream(WorkflowRunRequest $request, WorkflowStreamCallback $callback): void;

    /**
     * 获取工作流运行状态
     */
    public function getWorkflowRunStatus(string $taskId, string $user): WorkflowRunStatusResponse;

    /**
     * 停止工作流运行
     */
    public function stopWorkflowRun(string $taskId, string $user): WorkflowStopResponse;

    /**
     * 获取工作流运行日志
     */
    public function getWorkflowRunLogs(string $taskId, string $user): WorkflowLogsResponse;
}
